package main

import (
	"fmt"
	"math"
	"strings"
)

func BinaryFormat(n int32) string {
	a := uint32(n)
	sb := strings.Builder{}
	c := uint32(math.Pow(2, 31))
	for i := 0; i < 32; i++ {
		if a&c != 0 {
			sb.WriteString("1")
		} else {
			sb.WriteString("0")
		}
		c >>= 1
	}
	return sb.String()

}

func main() {
	var a int32 = 260
	fmt.Printf("260 %b\n", a)
	fmt.Printf("-260 %s\n", BinaryFormat(-260))
	fmt.Printf("^260 %s\n", BinaryFormat(^260))
	fmt.Printf("uint32(a):%b\n", uint32(a))
	fmt.Printf("uint32(-a):%b\n", uint32(-a))
	fmt.Printf("uint32(^a):%b\n", uint32(^a))
}
